// gmarea.h : Contains the gamemonkey code for interfacing with the area class
//$Id: gmArea.h 22 2009-08-17 18:26:57Z brwarner2 $

class CArea;

//Namespace container
namespace gmArea
{
	//Object for use as a user object
	struct gmAreaObject
	{
		CArea* pArea; //Area object
		gmTableObject* pTable; //Table object for use in GM
	};

	//GM User Type
	static gmType GM_AREA;

	//Registers the library
	void RegisterLibrary( gmMachine* );

	//Creates a new area object from an area
	gmUserObject* CreateAreaObject( gmMachine*, CArea* );

	//Destroys an area object
	void DestroyAreaObject( gmMachine*, gmUserObject* );

	//Garbage Collection stuff
	namespace GC {
		#if GM_USE_INCGC
		static bool GM_CDECL GCTrace(gmMachine * a_machine, gmUserObject* a_object, gmGarbageCollector* 
		a_gc, const int a_workLeftToDo, int& a_workDone);
		static void GM_CDECL GCDestruct(gmMachine * a_machine, gmUserObject* a_object);
		#else //GM_USE_INCGC
		// Garbage collect 'Mark' function
		void GM_CDECL GameObjectMark(gmMachine * a_machine, gmUserObject * a_object, gmuint32 a_mark);
		// Garbage collect 'Garbage Collect' function
		void GM_CDECL GameObjectGC(gmMachine * a_machine, gmUserObject * a_object, gmuint32 a_mark);
		#endif //GM_USE_INCGC
	}
}